# -*- coding:UTF-8 -*-
"""
@Project : SeleniumAutoTest
@File    : example5-xiecheng.py
@IDE     : PyCharm
@Author  : WorldWind(1772830365@qq.com)
@Address : China - HeiLongjiang - Herbin
@Date    : 2025/8/3 下午3:28
"""
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service

service = Service("D:\chromedriver-win64\chromedriver.exe")  # 配置chromedriver文件
dr = webdriver.Chrome(service=service)
dr.maximize_window()
dr.get("https://flights.ctrip.com/online/channel/domestic")
dr.implicitly_wait(10)  # 时间等待操作,隐式操作 整个driver生命周期都有效,不需要重复声明
dr.find_element(By.CLASS_NAME, 'search-btn').click()
dr.find_element(By.CSS_SELECTOR, '[u_key="next_segment"]').click()
